home *** CD-ROM | disk | FTP | other *** search
- Path: watnews.watson.ibm.com!kgold
- From: kgold@watson.ibm.com (Ken Goldman)
- Newsgroups: comp.sys.m68k
- Subject: Re: What is propper sequence for clearing CISR Register bits
- Date: 7 Mar 1996 14:57:01 GMT
- Organization: IBM T.J. Watson Research Center
- Distribution: world
- Message-ID: <4hmtft$kal@watnews1.watson.ibm.com>
- References: <4hfola$2b8@python.microcom.com>
- NNTP-Posting-Host: beta.watson.ibm.com
- Keywords: CISR 68360 Event Handling
-
- spellman@microcom.com (Roger Spellman) writes:
- |> The MC68360 QUICC manual gives an example of an SCC Interupt Handler.
- |> In Rev 1 of the manual, it is at the very end of chapter 7, in section
- |> 7.15.6.2, page 7-381. In this example, the SCC1 bit in the CISR is
- |> cleared *AFTER* the events for SCC1 are handled. To me, this seems
- |> backwards.
- |>
- |> Can someone tell me the right way to do it, and explain to me why?
- |>
-
- I think the example is right, but that it normally would not matter.
-
- There are two priorities to understand.
-
- 1 - Processor priority - 0 - 7, set by processor status register (SR)
- 2 - CPM priority - interrupts within the CPM, set by CICR, typically 4
-
- All CPM interrupts are at the same processor priority.
-
- When a bit in the CISR is set, it prevents interrupts at the same or
- lower CPM priority. If you cleared the CISR bit at the beginning of
- your handler, lower priority CPM events could preempt your handler.
- This might be OK, but is usually not desired.
-
- Entering the handler, the processor priority in the SR is set to the
- level of the CPM interrupt. This prevents all other CPM interrupts.
- Normally, the SR priority drops when the RTE is executed. In that
- case, it really doesn't matter when CISR clears.
-
- But if you have a higher processor priority interrupt during the
- handler, and that interrupt handler lowers the SR priority below that
- of the CPM (not normally done), then you need to clear CISR at the end
- of the handler to prevent lower priority CPM interrupts.
-
- Whew! The tech writers on the 68360 earned their paycheck.
-
- --
- Ken Goldman kgold@watson.ibm.com 914-784-7396
-